package com.cgtu.cgtucalculator.controller;

import com.cgtu.cgtucalculator.dto.Result;
import com.cgtu.cgtucalculator.enity.User;
import com.cgtu.cgtucalculator.mapper.UserMapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/user")
public class UserController {

    @Resource
    private UserMapper userMapper;

    @GetMapping("/list")
    public Result<List<User>> getAllUsers() {
        return Result.success(userMapper.selectList(null));
    }
}
